package com.study.controller;

import com.study.service.AccountService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import javax.annotation.Resource;


@RestController
@RequestMapping("/account")
public class AccountController {

    @Resource
    private AccountService accountService;

    @RequestMapping("/transfer")
    public String transferAccounts() {
        try {
            //1号张三  给2号李四  转账100元
            accountService.transferAccounts(1, 3, 100);
            return "转账成功！";
        } catch (Exception e) {
            System.out.println(e.toString());
            return "转账失败";
        }
    }
}
